<?php

namespace app\api\validate;

use app\common\basic\BaseValidate;

class AuthValidate extends BaseValidate
{
    protected $rule = [
        'username' => 'require|max:50',
        'password' => 'require|min:6|max:32',
        'refresh_token' => 'require',
    ];

    protected $message = [
        'username.require' => '用户名不能为空',
        'username.max' => '用户名不能超过50个字符',
        'password.require' => '密码不能为空',
        'password.min' => '密码至少6个字符',
        'password.max' => '密码不能超过32个字符',
        'refresh_token.require' => '刷新令牌不能为空',
    ];

    protected $scene = [
        'login' => ['username', 'password'],
        'refresh' => ['refresh_token'],
    ];
}